package com.yanxp.mybatis.config;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.yanxp.mybatis.mapper.Mapper;
import lombok.Getter;
import lombok.Setter;

import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author yuanxp
 * @Date 2021/3/4 15:38
 */
@Getter
@Setter
public class Configuration {

    private String driver;
    private String url;
    private String username;
    private String password;
    private DataSource dataSource;

    private Map<String, Mapper> mapper = new HashMap<>();

    public void add(String namespace, Mapper val) {
        mapper.put(namespace, val);
    }

    public Mapper getMapper(String namespace) {
        return mapper.get(namespace);
    }


}
